<%
'#################################################################################
'## UnWritten Open Source Blog Engine
'#################################################################################
'## Copyright (C) 2008 Luigi Violin
'##
'## This program is free software: you can redistribute it and/or modify
'## it under the terms of the GNU General Public License as published by
'## the Free Software Foundation, either version 2 of the License, or
'## (at your option) any later version.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program.  If not, see <http://www.gnu.org/licenses/>.
'##
'## You can obtain support from our forums at:
'##     <http://www.unwrittenblog.com/forums/>
'## Contact the author directly:
'##     <zaamit@hotmail.com/>
'##
'#################################################################################
%>
<!--#include file="check-login.asp"-->
<!--#include file="header.asp"-->
<!--#include file="sidebar.asp"-->
<%
function build_table(sql)
Response.Write "<table width=""100%"" class=""admin_table"">" & vbcrlf
Response.Write "<thead><tr>" & vbcrlf
Response.Write "	<th>Nick</th>" & vbcrlf
Response.Write "    <th>Member Since</th>" & vbcrlf
Response.Write "    <th>Last Visit</th>" & vbcrlf
Response.Write "    <th>User Level</th>" & vbcrlf
Response.Write "    <th>&nbsp;</th>" & vbcrlf
Response.Write "</tr></thead><tbody>" & vbcrlf
dbRS1.open sql,dbConn
if dbRS1.eof then
	Response.Write "<tr><td colspan=""5""><i>No content found</i></td></tr>"
end if
do while not(dbRS1.eof)
	Response.Write "<tr>"
	Response.Write "<td><a href=""/user.asp?name=" & dbRS1("nick") & """>" & dbRS1("nick") & "</a></td>"
	Response.Write "<td>" & dat2str(dbRS1("member_since")) & "</td>"
	Response.Write "<td>" & dat2str(dbRS1("last_visit")) & "</td>"
	Response.Write "<td>" & dbRS1("level") & "</td>"
	Response.Write "<td><a href=""user-edit.asp?id=" & dbRS1("id") & """>Edit</td>"
	Response.Write "</tr>"
	dbRS1.movenext
loop
dbRS1.close
Response.Write "<tbody></table>"
end function
%>
<div id="main">
	<div id="inner">
<h1>Site subscribers</h1>

<div class="form_buttons"><a href="edit.asp" class="biglink">CREATE NEW USER</a></div>

<div class="tabber" id="ausertab">
	<div class="tabbertab">
      <h2>LETTERS A-M</h2>
<%build_table("select * from " & db_prefix & "users where nick < 'N' order by member_since") %>
   </div>
   
	<div class="tabbertab">
      <h2>LETTERS N-Z</h2>
<%build_table("select * from " & db_prefix & "users where nick > 'M' order by member_since") %>
   </div>
</div>
<!-- /main inner --></div><!-- /main --></div>

<!--#include file="footer.asp"-->